*** This do file creates the database for  												*/
*** One Belt One Road paper																*/
*** Krishna Chaitanya Vadlamannati(UCD, Ireland) 										*/
*** Yuanxin Li (UCD, Ireland)															*/
*** Samuel Brazys (UCD, Ireland) 														*/
*****************************************************************************************
*** Last update: December 08, 2022
*****************************************************************************************
/* Note: This do file contains three parts: 											*/
/* 1) Preparation of data file															*/
/* 2) Data Manipulation		  															*/
/* 3) Regression Analysis 																*/
/* Change local China Aid to the directory where you store the raw data					*/
/* Running the do file creates the transformed data in the file "Master"				*/
/* The corresponding output tables are saved in the new folder "tables"					*/
/* The output tables are saved into excel using "outreg2" command						*/
*****************************************************************************************

set more off 

******************************** Provide labels ********************************************

label var sts_dummy "OBOR docs dummy"
label var sts1_dummy "OBOR MOU, JS, Meetings dummy"
label var st_dummy "OBOR mentioned docs dummy"
label var vote_yes "US votes YES"
label var vote_no "US votes NO"
label var vote_scale "US votes 0-2 scale"
label var china_aid "Chinese Aid (current prices)"
label var lnchina_aid "Chinese Aid current prices (log)"
label var caid_gdp "Chinese Aid/GDP"
label var caid_dac "Chinese Aid/DAC Aid"
label var chn_oda "Chinese ODA (current prices)"
label var chn_grant "Chinese Grants (current prices)"
label var usa_aid "USA Aid (current prices)"
label var lnusaid "USA Aid (log)"
label var dac_aid "DAC Aid (current prices)"
label var US_military "USA Military Aid dummy"
label var gdppc_con "Percapita GDP"
label var lnpcgdp "Percapita GDP (log)"
label var polity2 "Polity democracy index"
label var fh "Freedom House Democracy Index"
label var cl "Freedom House Civil Liberties Index"
label var pr "Freedom House Political Rights Index"
label var pop "Population"
label var lnpop "Population (log)"
label var steel "Steel production in China"
label var lnsteel "Steel production in China (log)"
label var lncrude_steel "Crude Steel production in China (log)"
label var lnrolled_steel "Rolled Steel production in China (log)"
label var iron "Iron production in China"
label var lniron "Iron production in China (log)"
label var gdp_cur "GDP in US$"
label var EYR "Imports from US"
label var IYR "Exports to US"
label var lntradeus "Exports and Imports with US (log)"
label var lnexp "Imports from US (log)"
label var conflict "civil war dummy"
label var Egypt_dummy "Egypt country dummy"
label var san_us "US sanctions dummy"
label var san_eu "EU sanctions dummy"
label var san_un "UN sanctions dummy"
label var probaid "Probability of Chinese Aid"
label var probaid_new "Probability of China Aid"
label var probaid_oda "Probability of Chinese ODA"
label var probaid_grant "Probability of Chinese Grants"
label var unsc "Member of UNSC"
label var USA_UNGA3 "UNGA voting index with US"
label var USA_UNGA3_im "UNGA voting index with US on key votes"
label var USA_UNGA4 "UNGA voting index with US (No ABS)"
label var USA_UNGA4_im "UNGA voting index with US on key votes (No ABS)"
label var lnres "China Forex Reserves (log)"
label var usaidg "US Aid to GDP"
label var oda_dac "Chinese Aid/DAC Aid"
label var lnbri_budget "BRI Budget (log)"
label var rate "China Steel Capacity Utilization Rate"
label var chris_per "Christian Population share"
label var coup "Military Coup"
label var SF "Failed State index"
label var PTS "PTS index"
label var EFI "EFI index"
label var easia "East Asia dummy"
label var sasia "South Asia dummy"
label var europ "Europe dummy"
label var lac "Latin America dummy"
label var mena "MENA dummy"
label var ssa "Sub-Saharan Africa dummy"
label var namerica "North America dummy"
label var chin "China dummy"
label var bid "MDB dummy"


******************************************************* Descriptive Statistics **********************************************************


sum(vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid caid_dac rate probaid_new)


****************************************************** Correlation Matrix ****************************************************************


corr(vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid caid_dac rate probaid_new)


*************************************************************************************************************************************************************************
*********************************************************************** TABLE 1  [BASELINE MODELS] **********************************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: logit vote_yes sts_dummy i.year, robust
tab country if e(sample)==1
estimates store t1
outreg2 using "t1", excel

* Column 2
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust
tab country if e(sample)==1
outreg2 using "t1", excel

* Column 3
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year, robust
tab country if e(sample)==1
outreg2 using "t1", excel

* Column 4
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.bid, robust
tab country if e(sample)==1
outreg2 using "t1", excel

* Column 5
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year i.bid, robust
tab country if e(sample)==1
outreg2 using "t1", excel


*************************************************************************************************************************************************************************
*********************************************************************** TABLE 2  [INTERACTION MODEL] ********************************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: logit vote_yes c.sts_dummy##c.caid_dac i.year, robust 
tab country if e(sample)==1
estimates store t2
outreg2 using "t2", excel

* Column 2
xi: logit vote_yes c.sts_dummy##c.caid_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust 
tab country if e(sample)==1
outreg2 using "t2", excel

* Column 3
xi: logit vote_yes c.sts_dummy##c.caid_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year, robust
tab country if e(sample)==1
outreg2 using "t2", excel

********************************************
***************** MARGIN PLOTS:
********************************************

* MARGIN PLOT: Column 2 = FIGURE 1
xi: logit vote_yes c.sts_dummy##c.caid_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust 
margins, dydx(sts_dummy) at(caid_dac=(0 (20) 100)(mean)_all) post
marginsplot, level(90) recast(line)


*************************************************************************************************************************************************************************
*********************************************************************** TABLE 3  [IV ESTIMATION MODEL] ******************************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: ivreg2 vote_yes i.year i.id (sts_dummy = c.rate##c.probaid_new), robust ffirst
tab country if e(sample)==1
estimates store t3
outreg2 using "t3", excel

* Column 2
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id (sts_dummy = c.rate##c.probaid_new), robust ffirst
tab country if e(sample)==1
outreg2 using "t3", excel

* Column 3
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year i.id (sts_dummy = c.rate##c.probaid_new), robust ffirst
tab country if e(sample)==1
outreg2 using "t3", excel

* Column 4
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id i.bid (sts_dummy = c.rate##c.probaid_new), robust ffirst
tab country if e(sample)==1
outreg2 using "t3", excel


****** FIGURE 2: Vizualised Effect of the IV: Capacity utilization rate
xi: reg sts_dummy c.rate#c.probaid_new lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id, robust
margins, dydx(probaid_new) at(rate=(72 (2) 82)(mean)_all) post
marginsplot, level(90) recast(line)
***************


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 1 [TABLE A - ALTERNATIVE BRI] ********************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: logit vote_yes sts1_dummy i.year, robust
tab country if e(sample)==1
estimates store r1
outreg2 using "r1", excel

* Column 2
xi: logit vote_yes sts1_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust
tab country if e(sample)==1
outreg2 using "r1", excel

* Column 3
xi: logit vote_yes sts1_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year, robust
tab country if e(sample)==1
outreg2 using "r1", excel

* Column 4
xi: logit vote_yes sts1_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.bid, robust
tab country if e(sample)==1
outreg2 using "r1", excel

* Column 5
xi: logit vote_yes sts1_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year i.bid, robust
tab country if e(sample)==1
outreg2 using "r1", excel


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 2  [TABLE B - ORDERED LOGIT MODEL] ***************************************************
*************************************************************************************************************************************************************************

* Column 1 Ordered Logit
xi: ologit vote_scale sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust
tab country if e(sample)==1
estimates store r2
outreg2 using "r2", excel

* Column 2 Ordered Logit
xi: ologit vote_scale sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year, robust
tab country if e(sample)==1
outreg2 using "r2", excel

* Column 3 Ordered Logit
xi: ologit vote_scale sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.bid i.year, robust
tab country if e(sample)==1
outreg2 using "r2", excel

* Column 4 Ordered Logit
xi: ologit vote_scale c.sts_dummy##c.caid_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust 
tab country if e(sample)==1
outreg2 using "r2", excel


************* MARGIN PLOT:
* xi: ologit vote_scale c.sts_dummy##c.caid_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust 
* margins, dydx(sts_dummy) at(caid_dac=(0 (20) 100)(mean)_all) post

******** MARGINAL EFFECT:
* xi: ologit vote_scale sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust
* mfx, predict(p outcome(2))
* mfx, predict(p outcome(2)) at(sts_dummy=1)

******** PARALLEL REG ASSUMPTION TEST:
* xi: omodel logit vote_scale sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year
 

*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 3  [TABLE C - OLS MODEL] *************************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: reg vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust
tab country if e(sample)==1
estimates store r3
outreg2 using "r3", excel

* Column 2
xi: reg vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year, robust
tab country if e(sample)==1
outreg2 using "r3", excel

* Column 3
xi: reg vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.bid i.year, robust
tab country if e(sample)==1
outreg2 using "r3", excel

* Column 4
xi: reg vote_yes c.sts_dummy##c.caid_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust 
tab country if e(sample)==1
outreg2 using "r3", excel

******************************************
*************** MARGIN PLOT: FIGURE A
******************************************
xi: reg vote_yes c.sts_dummy##c.caid_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid conflict i.year, robust 
margins, dydx(sts_dummy) at(caid_dac=(0 (20) 100)(mean)_all) post
marginsplot, level(90) recast(line)


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 4  [TABLE D - MULTINOMIAL MODEL] *****************************************************
*************************************************************************************************************************************************************************

* Column 1 Multinomial Logit
xi: mlogit vote_scale sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust
tab country if e(sample)==1
estimates store r4
outreg2 using "r4", excel

* Column 2 Multinomial Logit
xi: mlogit vote_scale sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year, robust
tab country if e(sample)==1
outreg2 using "r4", excel


*************************************************************************************************************************************************************************
******************************************************** ROBUSTNESS 5  [TABLE E - ALTERNATIVE INTERACTION MODEL] ********************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: logit vote_yes c.sts_dummy##c.caid_gdp lnpcgdp lnpop fh lnexp USA_UNGA4_im lnusaid i.year, robust
tab country if e(sample)==1
estimates store r5
outreg2 using "r5", excel

* Column 2
xi: logit vote_yes c.sts_dummy##c.caid_gdp lnpcgdp lnpop fh lnexp USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year, robust
tab country if e(sample)==1
outreg2 using "r5", excel

******************************************
*************** MARGIN PLOT: FIGURE B
******************************************
xi: logit vote_yes c.sts_dummy##c.caid_gdp lnpcgdp lnpop fh lnexp USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year, robust
margins, dydx(sts_dummy) at(caid_gdp=(0 (.2) 1.4)(mean)_all) post
marginsplot, level(90) recast(line)


*************************************************************************************************************************************************************************
******************************************************** ROBUSTNESS 6  [TABLE F - ALTERNATIVE INTERACTION MODEL] ********************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: logit vote_yes c.sts_dummy##c.oda_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year, robust 
tab country if e(sample)==1
estimates store r6
outreg2 using "r6", excel

* Column 2
xi: logit vote_yes c.sts_dummy##c.oda_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year, robust
outreg2 using "r6", excel

******************************************
*************** MARGIN PLOT: FIGURE C
******************************************
xi: logit vote_yes c.sts_dummy##c.oda_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year, robust
margins, dydx(sts_dummy) at(oda_dac=(0 (1) 6.7)(mean)_all) post
marginsplot, level(90) recast(line)


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 7  [TABLE G - KITCHEN SINK MODEL] ****************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid conflict san_us Egypt_dummy EFI PTS SF coup chris_per i.year, robust
tab country if e(sample)==1
estimates store r7
outreg2 using "r7", excel

* Column 2
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid conflict san_us Egypt_dummy EFI PTS SF coup chris_per easia sasia europ lac mena ssa namerica i.year, robust
tab country if e(sample)==1
outreg2 using "r7", excel

* Column 3
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid conflict san_us Egypt_dummy EFI PTS SF coup chris_per easia sasia europ lac mena ssa namerica i.bid i.year, robust
tab country if e(sample)==1
outreg2 using "r7", excel

* Column 4
xi: logit vote_yes c.sts_dummy##c.caid_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid conflict san_us Egypt_dummy EFI PTS SF coup chris_per i.year, robust
tab country if e(sample)==1
outreg2 using "r7", excel

******************************************
************* MARGIN PLOT: Figure D
******************************************
xi: logit vote_yes c.sts_dummy##c.caid_dac lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid conflict san_us Egypt_dummy EFI PTS SF coup chris_per i.year, robust
margins, dydx(sts_dummy) at(caid_dac=(0 (20) 100)(mean)_all) post
marginsplot, level(90) recast(line)


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 8  [TABLE H - ALTERNATIVE IV MODEL I] ************************************************
*************************************************************************************************************************************************************************

********** IV = BRI Budget

* Column 1
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id (sts_dummy = c.lnbri_budget##c.probaid_new), robust ffirst
tab country if e(sample)==1
estimates store r8
outreg2 using "r8", excel

* Column 2
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year i.id (sts_dummy = c.lnbri_budget##c.probaid_new), robust ffirst
tab country if e(sample)==1
outreg2 using "r8", excel

* Column 3
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.bid i.year i.id (sts_dummy = c.lnbri_budget##c.probaid_new), robust ffirst
tab country if e(sample)==1
outreg2 using "r8", excel


******** FIGURE:
xi: reg sts_dummy c.lnbri_budget#c.probaid_new probaid_new lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id, robust
margins, dydx(probaid_new) at(lnbri_budget=(4 (0.1) 4.8)(mean)_all) post
marginsplot, level(90) recast(line)


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 9  [TABLE I - ALTERNATIVE IV MODEL II] ***********************************************
*************************************************************************************************************************************************************************

********** IV = Iron + Capacity Utilization Rate of Steel

* Column 1
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id (sts_dummy = c.rate##c.probaid_new c.lniron##c.probaid_new), robust ffirst
estimates store r9
outreg2 using "r9", excel

* Column 2
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year i.id (sts_dummy = c.rate##c.probaid_new c.lniron##c.probaid_new), robust ffirst
outreg2 using "r9", excel

* Column 3
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id i.bid (sts_dummy = c.rate##c.probaid_new c.lniron##c.probaid_new), robust ffirst
outreg2 using "r9", excel


****** FIGURE: Vizualised Effect of the IV
xi: reg sts_dummy c.lniron#c.probaid_new lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id, robust
margins, dydx(probaid_new) at(lniron=(11 (.03) 11.2)(mean)_all) post
marginsplot, level(90) recast(line)


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 10  [TABLE J - ALTERNATIVE IV MODEL III] *********************************************
*************************************************************************************************************************************************************************

********** IV = Forex Reserves of China

* Column 1
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id (sts_dummy = c.lnres##c.probaid_new), robust ffirst
tab country if e(sample)==1
estimates store r10
outreg2 using "r10", excel

* Column 2
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year i.id (sts_dummy = c.lnres##c.probaid_new), robust ffirst
tab country if e(sample)==1
outreg2 using "r10", excel

* Column 3
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id i.bid (sts_dummy = c.lnres##c.probaid_new), robust ffirst
tab country if e(sample)==1
outreg2 using "r10", excel


****** FIGURE: Vizualised Effect of the IV
xi: reg sts_dummy c.lnres#c.probaid_new probaid_new lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id, robust
margins, dydx(probaid_new) at(lnres=(28.4 (.2) 29)(mean)_all) post
marginsplot, level(90) recast(line)


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 11  [TABLE K - DROP INSIGNIFICANT VARs] **********************************************
*************************************************************************************************************************************************************************

* Column 1
xi: ivreg2 vote_yes lnpcgdp fh USA_UNGA4_im i.year i.id (sts_dummy = c.rate##c.probaid_new), robust ffirst
estimates store r11
outreg2 using "r11", excel

* Column 2
xi: ivreg2 vote_yes lnpcgdp fh USA_UNGA4_im easia sasia europ lac mena ssa namerica i.year i.id (sts_dummy = c.rate##c.probaid_new), robust ffirst
outreg2 using "r11", excel

* Column 3
xi: ivreg2 vote_yes lnpcgdp fh USA_UNGA4_im i.year i.id i.bid (sts_dummy = c.rate##c.probaid_new), robust ffirst
outreg2 using "r11", excel


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 12  [TABLE L - WORLD BANK ONLY] ***********************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: logit vote_yes sts_dummy i.year if wb_dummy==1, robust
tab country if e(sample)==1
estimates store r12
outreg2 using "r12", excel

* Column 2
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year if wb_dummy==1, robust
tab country if e(sample)==1
outreg2 using "r12", excel

* Column 3
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year if wb_dummy==1, robust
tab country if e(sample)==1
outreg2 using "r12", excel

* Column 4
xi: ivreg2 vote_yes i.year i.id (sts_dummy = c.rate##c.probaid_new) if wb_dummy==1, robust ffirst
tab country if e(sample)==1
outreg2 using "r12", excel

* Column 5
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id (sts_dummy = c.rate##c.probaid_new) if wb_dummy==1, robust ffirst
tab country if e(sample)==1
outreg2 using "r12", excel

* Column 6
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year i.id (sts_dummy = c.rate##c.probaid_new) if wb_dummy==1, robust ffirst
tab country if e(sample)==1
outreg2 using "r12", excel


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 13  [TABLE M - WITHOUT IDB] ********************************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: logit vote_yes sts_dummy i.year if IDB_dummy==0, robust
tab country if e(sample)==1
estimates store r13
outreg2 using "r13", excel

* Column 2
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year if IDB_dummy==0, robust
tab country if e(sample)==1
outreg2 using "r13", excel

* Column 3
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year if IDB_dummy==0, robust
tab country if e(sample)==1
outreg2 using "r13", excel

* Column 4
xi: ivreg2 vote_yes i.year i.id (sts_dummy = c.rate##c.probaid_new) if IDB_dummy==0, robust ffirst
tab country if e(sample)==1
outreg2 using "r13", excel

* Column 5
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id (sts_dummy = c.rate##c.probaid_new) if IDB_dummy==0, robust ffirst
tab country if e(sample)==1
outreg2 using "r13", excel

* Column 6
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year i.id (sts_dummy = c.rate##c.probaid_new) if IDB_dummy==0, robust ffirst
tab country if e(sample)==1
outreg2 using "r13", excel


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 14  [TABLE N - WITHOUT IDB & AfDB] *************************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: logit vote_yes sts_dummy i.year if AFDB_dummy==0 & IDB_dummy==0, robust
tab country if e(sample)==1
estimates store r14
outreg2 using "r14", excel

* Column 2
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year if AFDB_dummy==0 & IDB_dummy==0, robust
tab country if e(sample)==1
outreg2 using "r14", excel

* Column 3
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year if AFDB_dummy==0 & IDB_dummy==0, robust
tab country if e(sample)==1
outreg2 using "r14", excel

* Column 4
xi: ivreg2 vote_yes i.year i.id (sts_dummy = c.rate##c.probaid_new) if AFDB_dummy==0 & IDB_dummy==0, robust ffirst
tab country if e(sample)==1
outreg2 using "r14", excel

* Column 5
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id (sts_dummy = c.rate##c.probaid_new) if AFDB_dummy==0 & IDB_dummy==0, robust ffirst
tab country if e(sample)==1
outreg2 using "r14", excel

* Column 6
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year i.id (sts_dummy = c.rate##c.probaid_new) if AFDB_dummy==0 & IDB_dummy==0, robust ffirst
tab country if e(sample)==1
outreg2 using "r14", excel


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 15  [TABLE O - WITHOUT CHINA] ******************************************************************
*************************************************************************************************************************************************************************

* Column 1
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year if chin==0, robust
tab country if e(sample)==1
estimates store r15
outreg2 using "r15", excel

* Column 2
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year if chin==0, robust
tab country if e(sample)==1
outreg2 using "r15", excel

* Column 3
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id (sts_dummy = c.rate##c.probaid_new) if chin==0, robust ffirst
tab country if e(sample)==1
outreg2 using "r15", excel

* Column 4
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year i.id (sts_dummy = c.rate##c.probaid_new) if chin==0, robust ffirst
tab country if e(sample)==1
outreg2 using "r15", excel


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 16  [TABLE P - OBAMA vs. TRUMP] ****************************************************************
*************************************************************************************************************************************************************************

* Column 1 (Obama)
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year if obama_dummy==1, robust
tab country if e(sample)==1
estimates store r16
outreg2 using "r16", excel

* Column 2 (Obama)
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year if obama_dummy==1, robust
tab country if e(sample)==1
outreg2 using "r16", excel

* Column 3 (Obama)
xi: ivreg2 vote_yes i.year i.id (sts_dummy = c.rate##c.probaid_new) if obama_dummy==1, robust ffirst
tab country if e(sample)==1
outreg2 using "r16", excel

* Column 4 (Obama)
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id (sts_dummy = c.rate##c.probaid_new) if obama_dummy==1, robust ffirst
tab country if e(sample)==1
outreg2 using "r16", excel

* Column 5 (Trump)
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year if obama_dummy==0, robust
tab country if e(sample)==1
outreg2 using "r16", excel

* Column 6 (Trump)
xi: logit vote_yes sts_dummy lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid easia sasia europ lac mena ssa namerica i.year if obama_dummy==0, robust
tab country if e(sample)==1
outreg2 using "r16", excel

* Column 7 (Trump)
xi: ivreg2 vote_yes i.year i.id (sts_dummy = c.rate##c.probaid_new) if obama_dummy==0, robust ffirst
tab country if e(sample)==1
outreg2 using "r16", excel

* Column 8 (Trump)
xi: ivreg2 vote_yes lnpcgdp lnpop fh lntradeus USA_UNGA4_im lnusaid i.year i.id (sts_dummy = c.rate##c.probaid_new) if obama_dummy==0, robust ffirst
tab country if e(sample)==1
outreg2 using "r16", excel


*************************************************************************************************************************************************************************
*********************************************************************** ROBUSTNESS 17  [ROBUSTNESS Q - US BILATERAL AID FLOWS] ******************************************
*************************************************************************************************************************************************************************

*******************************************************
************* ROBUSTNESS Q - MARGIN PLOT: Figure E
*******************************************************

xi: reg usaidg c.sts_dummy##c.caid_gdp lnpcgdp lnpop fh lntradeus USA_UNGA4_im i.year i.id, robust
margins, dydx(sts_dummy) at(caid_gdp=(0 (.2) 1.4)(mean)_all) post
marginsplot, level(90) recast(line)

